<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <title>Day3</title>
</head>
<style type="text/css">
    @import 'test.css';
</style>
<body>
    <div id="app">
        <h1 id="message" class="message" @click="clickMe">{{message}}</h1>
    </div>
    <script src="../dist/vue.js"></script>
    <script>
        const app = new Vue({
            el: '#app',
            data() {
                return {
                    message: 'Hello World',
                    arr: ['1', '2'],
                    obj: {}
                }
            },
            props: {
              testBoolean: {
                  type: Boolean
              },
              testString: {
                  type: String,
                  default: ''
              }
            },
            created() {
                this.$set(this.obj, 'test', 'Hello test')
            },
            mounted() {
                this.message = 'Hello NextTick'
                console.log('同步1', this.message, document.getElementById('message').innerHTML)
                this.$nextTick(() => {
                    console.log('tick1', this.message, document.getElementById('message').innerHTML)
                })
                this.$nextTick(() => {
                    console.log('tick2', this.message, document.getElementById('message').innerHTML)
                })
            },
            methods: {
                clickMe() {
                    console.log(1)
                }
            }
        })
    </script>
</body>
</html>
